﻿using supermarket.method;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace supermarket
{
    public partial class supdeleteuser : Form
    {
        Classuser u = new Classuser();
        Classdvclear dvc = new Classdvclear();
        public supdeleteuser()
        {
            InitializeComponent();
        }
        private void supdeleteuser_Load(object sender, EventArgs e)
        {
            dv1.RowCount = 1000;
            u.deleteuserinfotodv(dv1);

        }
        //返回
        private void button3_Click(object sender, EventArgs e)
        {
          

        }

        //清空
        private void button2_Click(object sender, EventArgs e)
        {
            dvc.dvclear(dv1, 5);
        }
      
        //删除
        private void button1_Click(object sender, EventArgs e)
        {
            if (u.deleteuser(dv1[2, dv1.CurrentCell.RowIndex].Value.ToString()) == 1)
            {
                MessageBox.Show("用户删除成功！");
                dvc.dvclear(dv1, 5);
                u.deleteuserinfotodv(dv1);
            }
            else
            {
                MessageBox.Show("用户删除失败！");
            }
        }

       
    }
}
